Kết xuấtvi

async fs leget

Translation status: Tiếng Việt reader-locale proof. Term names and code fences follow the vi pack; supporting prose may still be English.

Async fs.read_file_async<T> uses the same fs:lege route as sync fs.read_file<T>.

Syntax: fs.read_file_async<văn_bản>(thông_qua)

Category#

ad

Examples#

radix/corpus/ad/async-solum-leget.fab (canonical · concept)#

Async fs.read_file_async<T> uses the same fs:lege route as sync fs.read_file<T>.

# =============================================================================
# async chỉ leget — async solum.read_file_async<T> uses the same solum:lege route as
# sync solum.read_file<T>.
# =============================================================================
#
# What this teaches:
#   • Async/sync proof pair — `solum.read_file_async<T>` and `solum.read_file<T>` share the
#     same host route; the async callable posture selects the async receive path
#   • Import syntax — `nhập từ "norma:fs"` brings in standard library
#     modules
#
# Common mistakes:
#   • using an gọi expression outside the AIR làn or confusing the async route syntax — `solum.read_file_async<T>` must be awaited from `bắt_đầu_bất_đồng_bộ`
#
# See also: gọi, chỉ, tương_lai, kênh
# =============================================================================

# Async `gọi` materialization through a standard-library proof pair.
#
# `solum.read_file_async<T>` is the async-posture twin of `solum.read_file<T>`. Norma currently
# declares the wrapper with compatibility `@ tương_lai`; callers consume it through
# the explicit morphology forms such as `đợi_hằng`.

import from "norma:fs" charta

async_main {
    const string textPath ← "/tmp/faber-async-fs-leget.txt"
    charta.write_file(textPath, "async fs\n")
    await_const string body ← charta.read_file_async<string>(textPath)
    assert body ≡ "async fs\n"
}